//
//  CustomAnnotationView.m
//  PrayerTimes
//
//  Created by Igor Karpenko on 6/9/13.
//  Copyright (c) 2013 Igor Karpenko. All rights reserved.
//

#import "CustomAnnotationView.h"

@implementation CustomAnnotationView

@synthesize annotation;

-(id) initWithAnnotation:(id<MKAnnotation>)anAnnotation reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithAnnotation:anAnnotation reuseIdentifier:reuseIdentifier];
    if (!self) {
        return nil;
    }

	return self;
}


-(void) setAnnotation:(id<MKAnnotation>)anAnnotation {
	[anAnnotation retain];
	[annotation release];
	annotation = anAnnotation;
	
	
	UIImageView *leftImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:annotation.imageName]];
	leftImage.frame = CGRectMake(0.0f, 0.0f, 30.0f, 30.0f);
	self.leftCalloutAccessoryView = leftImage;
}

@end
